simulator [![size][size-image]][size-url]
Like _.defaults, assigns properties of source objects to a target, without overriding existing ones.
Install
$ npm install --save object-defaults
Usage
var defaults = require('object-defaults')
defaults({ foo: 0 }, { bar: 1 })
defaults({ foo: 0 }, { bar: 1 }, { baz: 2 })
defaults({ foo: 0 }, { foo: 1 }, { foo: 2 })
defaults({ foo: 0 }, null, '', { bar: 1 }, 0)
defaults(target, [source], [source, ...])
Assigns own enumerable properties of source
objects to the target
object and returns the
target
object. Existing properties are not overriden.
Related
License
MIT © Nicolas Gryman